package cn.cdeden.knowledge.service;


import cn.cdeden.common.core.utils.page.TableDataInfo;
import cn.cdeden.knowledge.domain.TeamTemplateTree;
import cn.cdeden.knowledge.domain.dto.TeamTemplateTreeDto;
import cn.cdeden.knowledge.domain.dto.TeamTemplateTreeQueryParam;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Set;

/**
* @author Chen
* @date 2024-05-17
*/
public interface TeamTemplateTreeService extends IService<TeamTemplateTree> {

    static final String CACHE_KEY = "teamTemplateTree";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<TeamTemplateTreeDto>
    */
    TableDataInfo<TeamTemplateTreeDto> queryAll(TeamTemplateTreeQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<TeamTemplateTreeDto>
    */
    List<TeamTemplateTreeDto> queryAll(TeamTemplateTreeQueryParam query);

    TeamTemplateTree getById(Long id);
    TeamTemplateTreeDto findById(Long id);

    /**
     * 插入一条新数据。
     */
    boolean insert(TeamTemplateTreeDto resources);
    boolean updateById(TeamTemplateTreeDto resources);
    boolean deleteById(Long id);
    boolean deleteByIds(Set<Long> ids);

    void uploadTemplate(MultipartFile image,MultipartFile multipartFile, String name, Long teamId) throws Exception;

    void updateTemplate(Long id, String realName);

    void removeTeamTemplate(Long id);

    void uploadTemplateAdmin(Long teamId, List<MultipartFile> files);

    void deleteAllByTeamId(String teamId);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<TeamTemplateTreeDto> all, HttpServletResponse response) throws IOException;
}
